package cn.edu.baiyunu.myapplication.ui.utils

import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.AttachMoney
import androidx.compose.material.icons.filled.Fastfood
import androidx.compose.material.icons.filled.Home
import androidx.compose.material.icons.filled.Insights
import androidx.compose.material.icons.filled.LocalTaxi
import androidx.compose.material.icons.filled.School
import androidx.compose.material.icons.filled.ShoppingCart
import androidx.compose.material.icons.filled.MedicalServices
import androidx.compose.material.icons.filled.Paid
import androidx.compose.material.icons.filled.ChildCare
import androidx.compose.material.icons.filled.Celebration
import androidx.compose.material.icons.filled.Flight
import androidx.compose.material.icons.filled.AccountBalance
import androidx.compose.material.icons.filled.CreditCard
import androidx.compose.material.icons.filled.Payments
import androidx.compose.material.icons.filled.CurrencyExchange
import androidx.compose.material.icons.filled.DirectionsCar
import androidx.compose.material.icons.filled.FamilyRestroom
import androidx.compose.material.icons.filled.CardGiftcard
import androidx.compose.material.icons.filled.Spa
import androidx.compose.material.icons.filled.SportsEsports
import androidx.compose.material.icons.filled.Savings
import androidx.compose.material.icons.automirrored.filled.Help
import androidx.compose.ui.graphics.vector.ImageVector

/**
 * 根据图标名称获取对应的ImageVector
 * 支持基本的Material图标
 */
fun getIconByName(iconName: String): ImageVector {
    return when (iconName.lowercase()) {
        "money" -> Icons.Filled.AttachMoney
        "food" -> Icons.Filled.Fastfood
        "home" -> Icons.Filled.Home
        "insights" -> Icons.Filled.Insights
        "taxi" -> Icons.Filled.LocalTaxi
        "education" -> Icons.Filled.School
        "shopping" -> Icons.Filled.ShoppingCart
        "medical" -> Icons.Filled.MedicalServices
        "salary" -> Icons.Filled.Paid
        "family" -> Icons.Filled.ChildCare
        "celebration" -> Icons.Filled.Celebration
        "travel" -> Icons.Filled.Flight
        "bank" -> Icons.Filled.AccountBalance
        "savings" -> Icons.Filled.Savings
        "account_balance" -> Icons.Filled.AccountBalance
        "credit_card" -> Icons.Filled.CreditCard
        "payments" -> Icons.Filled.Payments
        "currency_exchange" -> Icons.Filled.CurrencyExchange
        "directions_car" -> Icons.Filled.DirectionsCar
        "family_restroom" -> Icons.Filled.FamilyRestroom
        "card_giftcard" -> Icons.Filled.CardGiftcard
        "spa" -> Icons.Filled.Spa
        "sports_esports" -> Icons.Filled.SportsEsports
        else -> Icons.AutoMirrored.Filled.Help
    }
}

/**
 * 图标工具类
 */
object IconUtils {
    /**
     * 根据图标名称获取对应的ImageVector
     * 支持基本的Material图标
     */
    fun getIconByName(iconName: String): ImageVector {
        return cn.edu.baiyunu.myapplication.ui.utils.getIconByName(iconName)
    }
} 